import React from 'react'
import { withRouter } from 'react-router-dom'
import {Card} from "antd-mobile"
import "./countdown.less"
import shop from "../../../../assets/img/16@3x.png"

function countdown(props) {
  let {countdown,pre} = props
  return (
    <div className='countdown'>
    <Card title='2重利 倒计时特价商品专区 （限量供应，先到先得）' onClick={() => { }}>
        {countdown !==null ? (
            <>
                {countdown.map((item) => {
                    return (
                        <div className='countdown_div' key={item.id} onClick={() => { this. props.history.push("/detail/" + item.id+"/type=1") }}>
                            <img src={pre + item.img} alt="" />
                            <div>
                                <div>
                                    <p>￥{item.price}</p>
                                    <p>￥{item.market_price}</p>
                                </div>
                                <img src={shop} alt="" />
                            </div>
                        </div>
                    )
                })}
            </>
        ):<div>暂无数据</div>}
    </Card>
</div>
  )
}

export default withRouter(countdown)